package com.ejerciciolibre;

import java.util.ArrayList;
import java.util.Random;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;

public class ActivityQuestionnarie extends Activity {
	String Questions[];
	String TrueAnswer[];
	String answers[][];
	int ActualQuestion=0;
	int Wins;
	int Fails;
	TextView Question;
	TextView Question1;
	TextView Question2;
	TextView Question3;
	TextView Question4;
	TextView lblWins;
	TextView lblFails;	
	TextView congratulations;	
	TextView finalWins;
	TextView finalLose;	
	TextView FailsFinalUseless;
	TextView winsFinalUseless;
	ProgressBar BarQuestion;
	private ArrayList<Integer> list;
	private ArrayList<Integer> listQuestionFinal;
	int valueMin = 0;
	int valueMax = 5;
	int valueQuestionMin = 0;
	int sizeArrayOfQuestions = 12;
	int sizeMinOfArrayQuestion = 0;
	int valueReturn=0;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		setContentView(R.layout.activity_questionnarie);
		
		sizeMinOfArrayQuestion = 0;
		BarQuestion = (ProgressBar) this.findViewById(R.id.ProgressBarQuestions);
		BarQuestion.setProgress(0);
		listQuestionFinal = new ArrayList<Integer>();
		listQuestionFinal.add(0);
		listQuestionFinal.add(1);
		listQuestionFinal.add(2);
		listQuestionFinal.add(3);
		listQuestionFinal.add(4);
		listQuestionFinal.add(5);
		listQuestionFinal.add(6);
		listQuestionFinal.add(7);
		listQuestionFinal.add(8);
		listQuestionFinal.add(9);
		listQuestionFinal.add(10);
		listQuestionFinal.add(11);
		ActualQuestion = 1;
		Wins = 0;
		Fails = 0;
		Question = (TextView) findViewById(R.id.txtQuestion);
		Question1 = (TextView) findViewById(R.id.Response1);
		Question2 = (TextView) findViewById(R.id.Response2);
		Question3 = (TextView) findViewById(R.id.Response3);
		Question4 = (TextView) findViewById(R.id.Response4);
		lblWins = (TextView) findViewById(R.id.txtWins);
		lblFails = (TextView) findViewById(R.id.txtFails);
		
		
		
		switch(getIntent().getIntExtra("extraValue", 1))
		{
		case 1:
		
			Questions = new String[]{
					this.getResources().getString(R.string.NobQuestion1),
					this.getResources().getString(R.string.NobQuestion2),
					this.getResources().getString(R.string.NobQuestion3),
					this.getResources().getString(R.string.NobQuestion4),
					this.getResources().getString(R.string.NobQuestion5),
					this.getResources().getString(R.string.NobQuestion6),
					this.getResources().getString(R.string.NobQuestion7),
					this.getResources().getString(R.string.NobQuestion8),
					this.getResources().getString(R.string.NobQuestion9),
					this.getResources().getString(R.string.NobQuestion10),
					this.getResources().getString(R.string.NobQuestion11),
					this.getResources().getString(R.string.NobQuestion12)};
			TrueAnswer = new String[]{
					this.getResources().getString(R.string.NobResponseGood1),
					this.getResources().getString(R.string.NobResponseGood2),
					this.getResources().getString(R.string.NobResponseGood3),
					this.getResources().getString(R.string.NobResponseGood4),
					this.getResources().getString(R.string.NobResponseGood5),
					this.getResources().getString(R.string.NobResponseGood6),
					this.getResources().getString(R.string.NobResponseGood7),
					this.getResources().getString(R.string.NobResponseGood8),
					this.getResources().getString(R.string.NobResponseGood9),
					this.getResources().getString(R.string.NobResponseGood10),
					this.getResources().getString(R.string.NobResponseGood11),
					this.getResources().getString(R.string.NobResponseGood12)};			
				answers = new String[][]{
						{ this.getResources().getString(R.string.NobResponseBad1a1), this.getResources().getString(R.string.NobResponseBad1a2), this.getResources().getString(R.string.NobResponseBad1a3), this.getResources().getString(R.string.NobResponseBad1a4)},
						{ this.getResources().getString(R.string.NobResponseBad2a1), this.getResources().getString(R.string.NobResponseBad2a2), this.getResources().getString(R.string.NobResponseBad2a3), this.getResources().getString(R.string.NobResponseBad2a4)},
						{ this.getResources().getString(R.string.NobResponseBad3a1), this.getResources().getString(R.string.NobResponseBad3a2), this.getResources().getString(R.string.NobResponseBad3a3), this.getResources().getString(R.string.NobResponseBad3a4)},
						{ this.getResources().getString(R.string.NobResponseBad4a1), this.getResources().getString(R.string.NobResponseBad4a2), this.getResources().getString(R.string.NobResponseBad4a3), this.getResources().getString(R.string.NobResponseBad4a4)},
						{ this.getResources().getString(R.string.NobResponseBad5a1), this.getResources().getString(R.string.NobResponseBad5a2), this.getResources().getString(R.string.NobResponseBad5a3), this.getResources().getString(R.string.NobResponseBad5a4)},
						{ this.getResources().getString(R.string.NobResponseBad6a1), this.getResources().getString(R.string.NobResponseBad6a2), this.getResources().getString(R.string.NobResponseBad6a3), this.getResources().getString(R.string.NobResponseBad6a4)},
						{ this.getResources().getString(R.string.NobResponseBad7a1), this.getResources().getString(R.string.NobResponseBad7a2), this.getResources().getString(R.string.NobResponseBad7a3), this.getResources().getString(R.string.NobResponseBad7a4)},
						{ this.getResources().getString(R.string.NobResponseBad8a1), this.getResources().getString(R.string.NobResponseBad8a2), this.getResources().getString(R.string.NobResponseBad8a3), this.getResources().getString(R.string.NobResponseBad8a4)},
						{ this.getResources().getString(R.string.NobResponseBad9a1), this.getResources().getString(R.string.NobResponseBad9a2), this.getResources().getString(R.string.NobResponseBad9a3), this.getResources().getString(R.string.NobResponseBad9a4)},
						{ this.getResources().getString(R.string.NobResponseBad10a1), this.getResources().getString(R.string.NobResponseBad10a2), this.getResources().getString(R.string.NobResponseBad10a3), this.getResources().getString(R.string.NobResponseBad10a4)},
						{ this.getResources().getString(R.string.NobResponseBad11a1), this.getResources().getString(R.string.NobResponseBad11a2), this.getResources().getString(R.string.NobResponseBad11a3), this.getResources().getString(R.string.NobResponseBad11a4)},
						{ this.getResources().getString(R.string.NobResponseBad12a1), this.getResources().getString(R.string.NobResponseBad12a2), this.getResources().getString(R.string.NobResponseBad12a3), this.getResources().getString(R.string.NobResponseBad12a4)}
						};
			break;
			
		case 2:
			Questions = new String[]{
					this.getResources().getString(R.string.EasyQuestion1),
					this.getResources().getString(R.string.EasyQuestion2),
					this.getResources().getString(R.string.EasyQuestion3),
					this.getResources().getString(R.string.EasyQuestion4),
					this.getResources().getString(R.string.EasyQuestion5),
					this.getResources().getString(R.string.EasyQuestion6),
					this.getResources().getString(R.string.EasyQuestion7),
					this.getResources().getString(R.string.EasyQuestion8),
					this.getResources().getString(R.string.EasyQuestion9),
					this.getResources().getString(R.string.EasyQuestion10),
					this.getResources().getString(R.string.EasyQuestion11),
					this.getResources().getString(R.string.EasyQuestion12)};
			TrueAnswer = new String[]{
					this.getResources().getString(R.string.EasyResponseGood1),
					this.getResources().getString(R.string.EasyResponseGood2),
					this.getResources().getString(R.string.EasyResponseGood3),
					this.getResources().getString(R.string.EasyResponseGood4),
					this.getResources().getString(R.string.EasyResponseGood5),
					this.getResources().getString(R.string.EasyResponseGood6),
					this.getResources().getString(R.string.EasyResponseGood7),
					this.getResources().getString(R.string.EasyResponseGood8),
					this.getResources().getString(R.string.EasyResponseGood9),
					this.getResources().getString(R.string.EasyResponseGood10),
					this.getResources().getString(R.string.EasyResponseGood11),
					this.getResources().getString(R.string.EasyResponseGood12)};			
				answers = new String[][]{
						{ this.getResources().getString(R.string.EasyResponseBad1a1), this.getResources().getString(R.string.EasyResponseBad1a2), this.getResources().getString(R.string.EasyResponseBad1a3), this.getResources().getString(R.string.EasyResponseBad1a4)},
						{ this.getResources().getString(R.string.EasyResponseBad2a1), this.getResources().getString(R.string.EasyResponseBad2a2), this.getResources().getString(R.string.EasyResponseBad2a3), this.getResources().getString(R.string.EasyResponseBad2a4)},
						{ this.getResources().getString(R.string.EasyResponseBad3a1), this.getResources().getString(R.string.EasyResponseBad3a2), this.getResources().getString(R.string.EasyResponseBad3a3), this.getResources().getString(R.string.EasyResponseBad3a4)},
						{ this.getResources().getString(R.string.EasyResponseBad4a1), this.getResources().getString(R.string.EasyResponseBad4a2), this.getResources().getString(R.string.EasyResponseBad4a3), this.getResources().getString(R.string.EasyResponseBad4a4)},
						{ this.getResources().getString(R.string.EasyResponseBad5a1), this.getResources().getString(R.string.EasyResponseBad5a2), this.getResources().getString(R.string.EasyResponseBad5a3), this.getResources().getString(R.string.EasyResponseBad5a4)},
						{ this.getResources().getString(R.string.EasyResponseBad6a1), this.getResources().getString(R.string.EasyResponseBad6a2), this.getResources().getString(R.string.EasyResponseBad6a3), this.getResources().getString(R.string.EasyResponseBad6a4)},
						{ this.getResources().getString(R.string.EasyResponseBad7a1), this.getResources().getString(R.string.EasyResponseBad7a2), this.getResources().getString(R.string.EasyResponseBad7a3), this.getResources().getString(R.string.EasyResponseBad7a4)},
						{ this.getResources().getString(R.string.EasyResponseBad8a1), this.getResources().getString(R.string.EasyResponseBad8a2), this.getResources().getString(R.string.EasyResponseBad8a3), this.getResources().getString(R.string.EasyResponseBad8a4)},
						{ this.getResources().getString(R.string.EasyResponseBad9a1), this.getResources().getString(R.string.EasyResponseBad9a2), this.getResources().getString(R.string.EasyResponseBad9a3), this.getResources().getString(R.string.EasyResponseBad9a4)},
						{ this.getResources().getString(R.string.EasyResponseBad10a1), this.getResources().getString(R.string.EasyResponseBad10a2), this.getResources().getString(R.string.EasyResponseBad10a3), this.getResources().getString(R.string.EasyResponseBad10a4)},
						{ this.getResources().getString(R.string.EasyResponseBad11a1), this.getResources().getString(R.string.EasyResponseBad11a2), this.getResources().getString(R.string.EasyResponseBad11a3), this.getResources().getString(R.string.EasyResponseBad11a4)},
						{ this.getResources().getString(R.string.EasyResponseBad12a1), this.getResources().getString(R.string.EasyResponseBad12a2), this.getResources().getString(R.string.EasyResponseBad12a3), this.getResources().getString(R.string.EasyResponseBad12a4)}
						};
			break;
		case 3:
			Questions = new String[]{
					this.getResources().getString(R.string.NormalQuestion1),
					this.getResources().getString(R.string.NormalQuestion2),
					this.getResources().getString(R.string.NormalQuestion3),
					this.getResources().getString(R.string.NormalQuestion4),
					this.getResources().getString(R.string.NormalQuestion5),
					this.getResources().getString(R.string.NormalQuestion6),
					this.getResources().getString(R.string.NormalQuestion7),
					this.getResources().getString(R.string.NormalQuestion8),
					this.getResources().getString(R.string.NormalQuestion9),
					this.getResources().getString(R.string.NormalQuestion10),
					this.getResources().getString(R.string.NormalQuestion11),
					this.getResources().getString(R.string.NormalQuestion12)};
			TrueAnswer = new String[]{
					this.getResources().getString(R.string.NormalResponseGood1),
					this.getResources().getString(R.string.NormalResponseGood2),
					this.getResources().getString(R.string.NormalResponseGood3),
					this.getResources().getString(R.string.NormalResponseGood4),
					this.getResources().getString(R.string.NormalResponseGood5),
					this.getResources().getString(R.string.NormalResponseGood6),
					this.getResources().getString(R.string.NormalResponseGood7),
					this.getResources().getString(R.string.NormalResponseGood8),
					this.getResources().getString(R.string.NormalResponseGood9),
					this.getResources().getString(R.string.NormalResponseGood10),
					this.getResources().getString(R.string.NormalResponseGood11),
					this.getResources().getString(R.string.NormalResponseGood12)};			
				answers = new String[][]{
						{ this.getResources().getString(R.string.NormalResponseBad1a1), this.getResources().getString(R.string.NormalResponseBad1a2), this.getResources().getString(R.string.NormalResponseBad1a3), this.getResources().getString(R.string.NormalResponseBad1a4)},
						{ this.getResources().getString(R.string.NormalResponseBad2a1), this.getResources().getString(R.string.NormalResponseBad2a2), this.getResources().getString(R.string.NormalResponseBad2a3), this.getResources().getString(R.string.NormalResponseBad2a4)},
						{ this.getResources().getString(R.string.NormalResponseBad3a1), this.getResources().getString(R.string.NormalResponseBad3a2), this.getResources().getString(R.string.NormalResponseBad3a3), this.getResources().getString(R.string.NormalResponseBad3a4)},
						{ this.getResources().getString(R.string.NormalResponseBad4a1), this.getResources().getString(R.string.NormalResponseBad4a2), this.getResources().getString(R.string.NormalResponseBad4a3), this.getResources().getString(R.string.NormalResponseBad4a4)},
						{ this.getResources().getString(R.string.NormalResponseBad5a1), this.getResources().getString(R.string.NormalResponseBad5a2), this.getResources().getString(R.string.NormalResponseBad5a3), this.getResources().getString(R.string.NormalResponseBad5a4)},
						{ this.getResources().getString(R.string.NormalResponseBad6a1), this.getResources().getString(R.string.NormalResponseBad6a2), this.getResources().getString(R.string.NormalResponseBad6a3), this.getResources().getString(R.string.NormalResponseBad6a4)},
						{ this.getResources().getString(R.string.NormalResponseBad7a1), this.getResources().getString(R.string.NormalResponseBad7a2), this.getResources().getString(R.string.NormalResponseBad7a3), this.getResources().getString(R.string.NormalResponseBad7a4)},
						{ this.getResources().getString(R.string.NormalResponseBad8a1), this.getResources().getString(R.string.NormalResponseBad8a2), this.getResources().getString(R.string.NormalResponseBad8a3), this.getResources().getString(R.string.NormalResponseBad8a4)},
						{ this.getResources().getString(R.string.NormalResponseBad9a1), this.getResources().getString(R.string.NormalResponseBad9a2), this.getResources().getString(R.string.NormalResponseBad9a3), this.getResources().getString(R.string.NormalResponseBad9a4)},
						{ this.getResources().getString(R.string.NormalResponseBad10a1), this.getResources().getString(R.string.NormalResponseBad10a2), this.getResources().getString(R.string.NormalResponseBad10a3), this.getResources().getString(R.string.NormalResponseBad10a4)},
						{ this.getResources().getString(R.string.NormalResponseBad11a1), this.getResources().getString(R.string.NormalResponseBad11a2), this.getResources().getString(R.string.NormalResponseBad11a3), this.getResources().getString(R.string.NormalResponseBad11a4)},
						{ this.getResources().getString(R.string.NormalResponseBad12a1), this.getResources().getString(R.string.NormalResponseBad12a2), this.getResources().getString(R.string.NormalResponseBad12a3), this.getResources().getString(R.string.NormalResponseBad12a4)}
						};
			break;
		case 4:
			Questions = new String[]{
					this.getResources().getString(R.string.AdvancedQuestion1),
					this.getResources().getString(R.string.AdvancedQuestion2),
					this.getResources().getString(R.string.AdvancedQuestion3),
					this.getResources().getString(R.string.AdvancedQuestion4),
					this.getResources().getString(R.string.AdvancedQuestion5),
					this.getResources().getString(R.string.AdvancedQuestion6),
					this.getResources().getString(R.string.AdvancedQuestion7),
					this.getResources().getString(R.string.AdvancedQuestion8),
					this.getResources().getString(R.string.AdvancedQuestion9),
					this.getResources().getString(R.string.AdvancedQuestion10),
					this.getResources().getString(R.string.AdvancedQuestion11),
					this.getResources().getString(R.string.AdvancedQuestion12)};
			TrueAnswer = new String[]{
					this.getResources().getString(R.string.AdvancedResponseGood1),
					this.getResources().getString(R.string.AdvancedResponseGood2),
					this.getResources().getString(R.string.AdvancedResponseGood3),
					this.getResources().getString(R.string.AdvancedResponseGood4),
					this.getResources().getString(R.string.AdvancedResponseGood5),
					this.getResources().getString(R.string.AdvancedResponseGood6),
					this.getResources().getString(R.string.AdvancedResponseGood7),
					this.getResources().getString(R.string.AdvancedResponseGood8),
					this.getResources().getString(R.string.AdvancedResponseGood9),
					this.getResources().getString(R.string.AdvancedResponseGood10),
					this.getResources().getString(R.string.AdvancedResponseGood11),
					this.getResources().getString(R.string.AdvancedResponseGood12)};			
				answers = new String[][]{
						{ this.getResources().getString(R.string.AdvancedResponseBad1a1), this.getResources().getString(R.string.AdvancedResponseBad1a2), this.getResources().getString(R.string.AdvancedResponseBad1a3), this.getResources().getString(R.string.AdvancedResponseBad1a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad2a1), this.getResources().getString(R.string.AdvancedResponseBad2a2), this.getResources().getString(R.string.AdvancedResponseBad2a3), this.getResources().getString(R.string.AdvancedResponseBad2a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad3a1), this.getResources().getString(R.string.AdvancedResponseBad3a2), this.getResources().getString(R.string.AdvancedResponseBad3a3), this.getResources().getString(R.string.AdvancedResponseBad3a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad4a1), this.getResources().getString(R.string.AdvancedResponseBad4a2), this.getResources().getString(R.string.AdvancedResponseBad4a3), this.getResources().getString(R.string.AdvancedResponseBad4a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad5a1), this.getResources().getString(R.string.AdvancedResponseBad5a2), this.getResources().getString(R.string.AdvancedResponseBad5a3), this.getResources().getString(R.string.AdvancedResponseBad5a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad6a1), this.getResources().getString(R.string.AdvancedResponseBad6a2), this.getResources().getString(R.string.AdvancedResponseBad6a3), this.getResources().getString(R.string.AdvancedResponseBad6a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad7a1), this.getResources().getString(R.string.AdvancedResponseBad7a2), this.getResources().getString(R.string.AdvancedResponseBad7a3), this.getResources().getString(R.string.AdvancedResponseBad7a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad8a1), this.getResources().getString(R.string.AdvancedResponseBad8a2), this.getResources().getString(R.string.AdvancedResponseBad8a3), this.getResources().getString(R.string.AdvancedResponseBad8a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad9a1), this.getResources().getString(R.string.AdvancedResponseBad9a2), this.getResources().getString(R.string.AdvancedResponseBad9a3), this.getResources().getString(R.string.AdvancedResponseBad9a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad10a1), this.getResources().getString(R.string.AdvancedResponseBad10a2), this.getResources().getString(R.string.AdvancedResponseBad10a3), this.getResources().getString(R.string.AdvancedResponseBad10a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad11a1), this.getResources().getString(R.string.AdvancedResponseBad11a2), this.getResources().getString(R.string.AdvancedResponseBad11a3), this.getResources().getString(R.string.AdvancedResponseBad11a4)},
						{ this.getResources().getString(R.string.AdvancedResponseBad12a1), this.getResources().getString(R.string.AdvancedResponseBad12a2), this.getResources().getString(R.string.AdvancedResponseBad12a3), this.getResources().getString(R.string.AdvancedResponseBad12a4)}
						};
			break;
		
		
		}
		
					
		
		Random r = new Random();
		int valuemin = 0;
		int nummax = listQuestionFinal.size();
		int randomvalue = r.nextInt((nummax - valuemin) + valuemin);			
		valueReturn = listQuestionFinal.get(randomvalue);
		listQuestionFinal.remove(randomvalue);			
		DrawnQuestion(valueReturn);		
		
	}
	public void writeQuestion(){	
		String winfinal = Integer.toString(Wins);		
		lblWins.setText(winfinal);
		winfinal = Integer.toString(Fails);	
		lblFails.setText(winfinal);	
			Intent a = new Intent(this, ActivityResult.class);
			String winsend = Integer.toString(Wins);			
			a.putExtra("Wins", winsend);
			String failsend = Integer.toString(Fails);
			a.putExtra("Fails", failsend);
			startActivity(a);
			this.finish();
		
	}

	public void Question1Response(View v){
		String textoboton = (String) Question1.getText();		
		comprobarRespuesta(textoboton);
	}
	public void Question2Response(View v){
		String textoboton = (String) Question2.getText();		
		comprobarRespuesta(textoboton);
	}
	public void Question3Response(View v){
		String textoboton = (String) Question3.getText();		
		comprobarRespuesta(textoboton);
	}
	public void Question4Response(View v){
		String textoboton = (String) Question4.getText();		
		comprobarRespuesta(textoboton);
	}
	
	public void comprobarRespuesta(String response){
		if (response==TrueAnswer[valueReturn]){
			Wins = Wins+1;
		} else {
			Fails = Fails+1;
		}
		String finalwins = Integer.toString(Wins);		
		lblWins.setText(finalwins);
		finalwins = Integer.toString(Fails);	
		lblFails.setText(finalwins);	
		switch (ActualQuestion+1){
		case 1:
			BarQuestion.setProgress(8);
			break;
		case 2:
			BarQuestion.setProgress(16);
			break;
		case 3:
			BarQuestion.setProgress(24);
			break;
		case 4:
			BarQuestion.setProgress(32);
			break;
		case 5:
			BarQuestion.setProgress(40);
			break;
		case 6:
			BarQuestion.setProgress(48);
			break;
		case 7:
			BarQuestion.setProgress(56);
			break;
		case 8:
			BarQuestion.setProgress(64);
			break;
		case 9:
			BarQuestion.setProgress(72);
			break;
		case 10:
			BarQuestion.setProgress(80);
			break;
		case 11:
			BarQuestion.setProgress(88);
			break;
		case 12:
			BarQuestion.setProgress(110);
			break;
		}
		ActualQuestion = ActualQuestion+1;		
		String mensaje = Integer.toString(ActualQuestion);			
		if (ActualQuestion<13){
			Random r = new Random();
			int numeromin = 0;
			int nummax = listQuestionFinal.size();
			int valorAleatorio = r.nextInt((nummax - numeromin) + numeromin);
			valueReturn = listQuestionFinal.get(valorAleatorio);
			listQuestionFinal.remove(valorAleatorio);	
			DrawnQuestion(valueReturn);	
		} else{
			writeQuestion();
		}
	}
	public void DrawnQuestion(int PreguntaADibujar){
		list = new ArrayList<Integer>();		
		list.add(0);
		list.add(1);
		list.add(2);
		list.add(3);			
		int numero1;
		int numero2;
		int numero3;
		int numero4;		
		Random r = new Random();
		valueMin = 0;
		valueMax = 4;
		Question.setText(Questions[PreguntaADibujar]);
		int valorAleatorio = r.nextInt((valueMax - valueMin) + valueMin);
		numero1 = list.get(valorAleatorio);
		list.remove(valorAleatorio);
		valueMax =3;
		int valorAleatorio1 = r.nextInt((valueMax - valueMin) + valueMin);
		numero2 = list.get(valorAleatorio1);
		list.remove(valorAleatorio1);
		valueMax =2;
		int valorAleatorio2 = r.nextInt((valueMax - valueMin) + valueMin);
		numero3 = list.get(valorAleatorio2);
		list.remove(valorAleatorio2);
		numero4 = list.get(0);
		list.remove(0);
		Question1.setText(answers[PreguntaADibujar][numero1]);
		Question2.setText(answers[PreguntaADibujar][numero2]);
		Question3.setText(answers[PreguntaADibujar][numero3]);
		Question4.setText(answers[PreguntaADibujar][numero4]);
		}
}